import Vue from 'vue'
// 直接将Vue组件作为Vue.extend的参数
import popEvent from "./popEvent";
import store from "@/store";
import router from "@/router"

const showPopEvent = (data, config) => {
    const popEventConstructor = Vue.extend(popEvent);
    const instance = new popEventConstructor({
        el: document.createElement("div"),
        store,
        router
    });
    console.log(instance.$el);

    document.querySelector("body").appendChild(instance.$el);
    return instance.show(data, config);
}

export default showPopEvent;